-
Notifications
You must be signed in to change notification settings - Fork 181
Fix: Detect type errors for bare return statements (#1508) #1524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Detect type errors for bare return statements (#1508) #1524
Conversation
## Changes 1. Added `range` field to `ReturnExplicit` struct to track the return statement location 2. Updated `binding/function.rs` to pass the range when creating `ReturnExplicit` 3. Added type checking in `solve.rs` for bare return ## Testing - ✅ Added 3 new test cases in returns.rs Fixes facebook#1508
ndmitchell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review automatically exported from Phabricator review in Meta.
yangdanny97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review automatically exported from Phabricator review in Meta.
grievejia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review automatically exported from Phabricator review in Meta.
|
@yangdanny97 could you please let me know what changes i need to make as im not able to see why internal build & tests failed!!! |
|
@AryanBagade I just checked, and it looks like the internal build was failing for an unrelated issue, and Danny's comment was resolved, so no action required here. Thanks for contributing this fix (for a slightly embarrassing bug XD), and sorry the internal review process is so opaque. We wanted to export the review status so contributors can see when their PR is approved, but we don't have fine-grained control over what information is exported. |
|
@yangdanny97 merged this pull request in fc91a0f. |
Changes
rangefield toReturnExplicitstruct to track the return statement locationbinding/function.rsto pass the range when creatingReturnExplicitsolve.rsfor bare returnTesting
Fixes #1508